<!-- menus -->
<template>
  <view class="menus border-top" :style="{ 'margin-top': gapNumber * 34 + 'rpx' }">
    <view
      class="menus_cell d-flex border-bottom"
      v-for="item in list"
      :key="item.es_name"
      @click="openPage(item)"
    >
      <text class="siyuan-medium">{{ item.name }}</text>
      <text class="intel-one-mono-medium">{{ item.es_name }}</text>
    </view>
  </view>
</template>

<script setup>
let emits = defineEmits(["btnClick"]);
let props = defineProps({
  list: {
    type: Array,
    default: [],
  },
  gapNumber: {
    type: Number,
    default: 1,
  },
});

let openPage = item => {
  if (item.path) {
    uni.navigateTo({
      url: item.path,
    });
    return;
  }
  emits("btnClick", item);
};
</script>

<style lang="scss" scoped>
.menus {
  background-color: #ffffff;
  &_cell {
    height: 100rpx;
    align-items: center;
    justify-content: center;
    font-size: 26rpx;
    text {
      min-width: 120rpx;
      margin: 0 26rpx;
      display: inline-block;
    }
    text:first-child {
      text-align: left;
    }
    text:first-child + text {
      text-align: left;
    }
  }
}
</style>
